# 'print' does not append a newline; 'puts' does
print "Hello, "

=begin
    'then' is optional and only needed when a 'when' statement is a single line
    with its execution expression.  Otherwise just put it on its own line and
    leave out 'then'.
=end
case ARGV.length
when 0 then print "World"
when 1 then print ARGV.first
else
    ARGV[0..-2].each {|name|
        print "#{name}, "
    }
    print "and " << ARGV.last
end

puts "!"
